package com.sky.mapper;

import com.sky.dto.EmployeeDTO;
import com.sky.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);

    /**
     * @param name 员工姓名
     * @return
     */
    List<Employee> getPage(String name);

    void insertEmployee(Employee employee);

    /**
     * @param id 员工id
     * @return
     */
    Employee getById(int id);

    void updateById(Employee employee);

}
